package com.google.code.chaotic.model;

import java.io.Serializable;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.code.chaotic.dto.UserType;

//

@PersistenceCapable
@javax.jdo.annotations.Inheritance(customStrategy = "complete-table")
public class User implements Serializable {

	/** @uml.property name="id" */
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
	protected String id;

	/** @uml.property name="userTypeId" */
	@Persistent
	protected String userTypeId;

	/** @uml.property name="username" */
	@Persistent
	private String username;

	/** @uml.property name="passwordMd5" */
	@Persistent
	private String passwordMd5;

	/** @uml.property name="firstName" */
	@Persistent
	private String firstName;

	/** @uml.property name="lastName" */
	@Persistent
	private String lastName;

	/** @uml.property name="email" */
	@Persistent
	private String email;

	//

	/** @uml.property name="id" */
	public void setId(String id) {
		this.id = id;
	}

	/** @uml.property name="id" */
	public String getId() {
		return id;
	}

	/** @uml.property name="userTypeId" */
	public String getUserTypeId() {
		return userTypeId;
	}

	/** @uml.property name="userTypeId" */
	public UserType getUserType() {
		return UserType.getById(userTypeId);
	}

	/** @uml.property name="username" */
	public String getUsername() {
		return username;
	}

	/** @uml.property name="username" */
	public void setUsername(String username) {
		this.username = username;
	}

	/** @uml.property name="firstName" */
	public String getFirstName() {
		return firstName;
	}

	/** @uml.property name="firstName" */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	/** @uml.property name="passwordMd5" */
	public String getPasswordMd5() {
		return passwordMd5;
	}

	/** @uml.property name="passwordMd5" */
	public void setPasswordMd5(String password) {
		this.passwordMd5 = password;
	}

	/** @uml.property name="lastName" */
	public String getLastName() {
		return lastName;
	}

	/** @uml.property name="lastName" */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	/** @uml.property name="email" */
	public String getEmail() {
		return email;
	}

	/** @uml.property name="email" */
	public void setEmail(String email) {
		this.email = email;
	}

}
